'use strict';
var mongoose = require('mongoose'),
    Schema = mongoose.Schema;

function inspector (val, schematype) {
    if (schematype.options.required) {
        return schematype.path + ' is required';
    }
    else {
        return schematype.path + ' is not';
    }
 }

var BaseDoc = {
    getBaseDocFields: function(){
        return {
            //版本
            SysVersion: {
                type: Number
            },
            //创建时间
            CreatedOn: {
                type: Date,
                default: Date.now
                // get: inspector
            },
            //创建人
            CreatedBy: {
                type: Schema.ObjectId,
                ref: 'User'
            },
            //修改时间
            ModifyOn: {
                type: Date,
                default: Date.now
            },
            //修改人
            ModifyBy: {
                type: Schema.ObjectId,
                ref: 'User'
            }
            // //打印人
            // PrintPerson: {
            //     type: String,
            //     trim: true
            // },
            // //最后一次打印时间
            // LastPrintDateTime: {
            //     type: Date
            // },
            // //累计打印次数
            // TotalPrintQty: {
            //     type: Number
            // }
        };
    }
}

module.exports = BaseDoc;
/**
 * Created by 陈伟 on 2015/12/9.
 */
